<template>
  <div class="wx-open-subscribe-container" style="position:absolute;width:100%;height:100%;top:0px;">
    <wx-open-launch-weapp
      id="launch-btn"
      username="gh_2e8b620a67f5" 
      :path="wxPath" 
      style="position:absolute;width:100%;height:100%;left:0px;top:0px;overflow:hidden;"
    >
      <script type="text/wxtag-template">
        <style>.btn { width: 100%; height: 500px;}</style>
        <div class="btn"></div>
      </script>
    </wx-open-launch-weapp>
  </div>
</template>

<script>
  export default {
    props:{
      wxPath:{
        type: String
      }
    },
    mounted() {
      const vm = this
      let subscribebtn = document.getElementById('launch-btn');
      subscribebtn.addEventListener('launch', function (e) { 
        vm.$emit('launch', e)
      })
    }
  }
</script>

<style>
</style>
